<template>
  <div>
    <div class="plan_sectons">
      <persons
        @list_dynamic="listDynamic"
        @list_visitor="listVistor"
        @list_Myvisitor="listMyvisitor"
        @list_Mevisitor="listMevisitor"
        @list_mythumb="listMythumb"
        @Gold_recharge="GoldRecharge(arguments)"
        @Upgrade_members="UpgradeMembers"
        @Buy_translation="BuyTranslation(arguments)"
        @customer_server="customerServer"
      />
      <!-- //好友动态 -->
      <dynamics
        v-if="seled_titles == 1"
        @friend_dy="friendDy"
        @ononline="online_lines"
        @head_portrait="headImg"
      />
      <!-- 我的动态 -->
      <my-dynamics
        v-if="seled_titles == 3"
        @editorContent="publish_dyanamics"
      />
      <!-- //访客组件 -->
      <visitors v-if="seled_titles == 2" />
      <!-- 点赞我的 -->
      <visitors :seled_t="seled_titles" v-if="seled_titles == 4" />
      <!-- 我的点赞 -->
      <visitors :seled_t="seled_titles" v-if="seled_titles == 5" />
      <!-- 购买金币 -->
      <buyCoins :seled_t="seled_titles" :gold_value="gold_value" v-if="seled_titles == 6" />
      <!-- 升级会员 -->
      <buyMember :seled_t="seled_titles" v-if="seled_titles == 7" />
      <!-- 购买翻译包 -->
      <buyTranslate :seled_t="seled_titles" :CharacterCount_value="CharacterCount_value" v-if="seled_titles == 8" />
    </div>
    <release-dy v-if="Publish_pop" @closes="close_cloe" />
  </div>
</template>
<script>
//<release-dy/>
import releaseDy from "../../components/ReleaseDynamics.vue";
//购买金币
import buyCoins from "../../components/MeCoins.vue";
//升级会员
import buyMember from "../../components/MeMember.vue";
//购买翻译包
import buyTranslate from "../../components/MeTranslate.vue";
export default {
  name: "find",
  components: {
    releaseDy,
    buyCoins,
    buyMember,
    buyTranslate,
  },
  data: () => ({
    seled_titles: 1,
    Publish_pop: false,
    gold_value:'',
    CharacterCount_value:''
  }),
  watch: {
    $route() {
      if (this.$route.query.from) {
        this.seled_titles = this.$route.query.from;
      } else {
        this.seled_titles = 1;
      }
    },
  },
  methods: {
    friendDy() {
      // this.$layer.msg('friend_dynamics');
    },
    online_lines() {
      // this.$layer.msg('ononline');
      console.log(23123123123);
    },
    //好友动态
    listDynamic(e) {
      this.seled_titles = e;
    },
    //我的访客
    listVistor(e) {
      this.seled_titles = e;
    },
    //我的动态
    listMyvisitor(e) {
      this.seled_titles = e;
    },
    //点赞我的
    listMevisitor(e) {
      this.seled_titles = e;
    },
    //我的点赞
    listMythumb(e) {
      this.seled_titles = e;
    },
    publish_dyanamics() {
      this.Publish_pop = true;
    },
    close_cloe() {
      this.Publish_pop = false;
    },
    headImg() {
      //点击用户头像的跳转
      this.$router.push({ path: "/otherPage" });
    },
    //金币充值
    GoldRecharge(e) {
      console.log(e)
      this.seled_titles = e[0];
      this.gold_value=e[1]
    },
    //会员升级
    UpgradeMembers(e) {
      this.seled_titles = e;
    },
    //购买翻译包
    BuyTranslation(e) {
      this.seled_titles = e[0];
      this.CharacterCount_value=e[1]
    },
    customerServer() {
      this.$router.push({ path: "/chat" });
    }
  },
};
</script>

<style scoped>
.plan_sectons {
  display: flex;
  width: 65%;
  margin: 0 auto;
  justify-content: space-between;
  padding: 15px;
}
</style>